/* 
 * File:   UnaryOperator.h
 * Author: Gab'z
 *
 * Created on 29 mai 2012, 22:03
 */

#ifndef UNARYOPERATOR_H
#define	UNARYOPERATOR_H

#include "../Operator.h"
#include "../../literal/Number.h"

namespace calculator {

    class UnaryOperator : public Operator {
    public:
        virtual std::string isExecutable() const;
        virtual UnaryOperator* clone() const = 0;

        const Memento* createMemento() const throw (CommandException);

    protected:
        virtual const Number* apply(const Number* number) const throw (ArithmeticException) = 0;
        UnaryOperator(const std::string name);
        virtual ~UnaryOperator();
    private:
        void eval(Stack* stack) const throw (CommandException);
        UnaryOperator(const UnaryOperator& orig);
    };
}

#endif	/* UNARYOPERATOR_H */

